<div class="inner">
				<h2><?=$files['nm_obat'];?></h2><br/>
				<form action="<?=site_url('myfile/UpdateStok');?>" method="post" id="stok" name="stok">
					<?=form_hidden('id',$files['id_obat']);?>
					<p>Kem.Sdng(<?=$files['box_sedang'];?>) <?=form_input('box_sedang','','style="width:30px" id="box_sedang" onkeyup="calculate()" onBlur="calculate()"')?><?=form_input('total_sedang','0','disabled="disabled" style="width:40px"')?></p>
					<p>Kem.Kcil(<?=$files['box_kecil'];?>)&nbsp;&nbsp;&nbsp;&nbsp;<?=form_input('box_kecil','','style="width:30px" id="box_kecil" onkeyup="calculate()" onBlur="calculate()"')?><?=form_input('total_kecil','0','disabled="disabled" style="width:40px"')?></p>
					<p>Kem.Sat &nbsp;&nbsp;   <?=form_input('box_satuan','','style="width:40px" id="box_satuan" onkeyup="calculate()" onBlur="calculate()"')?></p>
					<p>---------------------------------------</p>
					
					<p>Total &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <?=form_input('box_total','','disabled="disabled" style="width:50px"')?></p>
					<!--
					<p>Selisih &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <?=form_input('box_selisih','','disabled="disabled" style="width:50px"')?></p>
					-->
					<p>
					<input type="submit" name="submit" value="Submit" OnClick="return confirm('are you sure want to Submit');" />
					</p>
				</form>
</div>

<script type="text/javascript">
	function calculate(){
		 var bs = document.getElementById("box_sedang");
		 var bk = document.getElementById("box_kecil");
		 var bst= document.getElementById("box_satuan");
		 var b;
		 var k;	
		 var s;
		 var total;
		 showKeyCode();
		 showKeyCode2();
		 showKeyCode3();
		 b=document.stok.total_sedang.value= bs.value * <?=$files['box_sedang'];?>;
		 k=document.stok.total_kecil.value= bk.value * <?=$files['box_kecil'];?>;
		 s=bst.value * 1; 
		 total=(b+k)+(s);
		 document.stok.box_total.value=total;
		 document.stok.box_selisih.value=total - <?=$files['sisa'];?>;
		 
	}
		<!-- Begin
		function showKeyCode()
		{
		 //var character = document.stok.box_sedang.value.substring(0,1);
		 var code = document.stok.box_sedang.value;
		 var x;
			x=code.replace(".","1");
			x=x.replace(",","1");
			x=x.replace("-","1");
			x=x.replace("a","2");
			x=x.replace("b","2");
			x=x.replace("c","2");
			x=x.replace("d","3");
			x=x.replace("e","3");
			x=x.replace("f","3");
			x=x.replace("g","4");
			x=x.replace("h","4");
			x=x.replace("i","4");
			x=x.replace("j","5");
			x=x.replace("k","5");
			x=x.replace("l","5");
			x=x.replace("m","6");
			x=x.replace("n","6");
			x=x.replace("o","6");
			x=x.replace("p","7");
			x=x.replace("q","7");
			x=x.replace("r","7");
			x=x.replace("s","7");
			x=x.replace("t","8");
			x=x.replace("u","8");
			x=x.replace("v","8");
			x=x.replace("w","9");
			x=x.replace("x","9");
			x=x.replace("y","9");
			x=x.replace("z","9");
			x=x.replace("/","0");
			x=x.replace(" ","0");
		   document.stok.box_sedang.value=x;
		}
		//  End -->
		
		<!-- Begin
		function showKeyCode2()
		{
		 //var character = document.stok.box_sedang.value.substring(0,1);
		 var code = document.stok.box_kecil.value;
		 var x;
			x=code.replace(".","1");
			x=x.replace(",","1");
			x=x.replace("-","1");
			x=x.replace("a","2");
			x=x.replace("b","2");
			x=x.replace("c","2");
			x=x.replace("d","3");
			x=x.replace("e","3");
			x=x.replace("f","3");
			x=x.replace("g","4");
			x=x.replace("h","4");
			x=x.replace("i","4");
			x=x.replace("j","5");
			x=x.replace("k","5");
			x=x.replace("l","5");
			x=x.replace("m","6");
			x=x.replace("n","6");
			x=x.replace("o","6");
			x=x.replace("p","7");
			x=x.replace("q","7");
			x=x.replace("r","7");
			x=x.replace("s","7");
			x=x.replace("t","8");
			x=x.replace("u","8");
			x=x.replace("v","8");
			x=x.replace("w","9");
			x=x.replace("x","9");
			x=x.replace("y","9");
			x=x.replace("z","9");
			x=x.replace("/","0");
			x=x.replace(" ","0");
		   document.stok.box_kecil.value=x;
		}
		//  End -->
		
		<!-- Begin
		function showKeyCode3()
		{
		 //var character = document.stok.box_sedang.value.substring(0,1);
		 var code = document.stok.box_satuan.value;
		 var x;
			x=code.replace(".","1");
			x=x.replace(",","1");
			x=x.replace("-","1");
			x=x.replace("a","2");
			x=x.replace("b","2");
			x=x.replace("c","2");
			x=x.replace("d","3");
			x=x.replace("e","3");
			x=x.replace("f","3");
			x=x.replace("g","4");
			x=x.replace("h","4");
			x=x.replace("i","4");
			x=x.replace("j","5");
			x=x.replace("k","5");
			x=x.replace("l","5");
			x=x.replace("m","6");
			x=x.replace("n","6");
			x=x.replace("o","6");
			x=x.replace("p","7");
			x=x.replace("q","7");
			x=x.replace("r","7");
			x=x.replace("s","7");
			x=x.replace("t","8");
			x=x.replace("u","8");
			x=x.replace("v","8");
			x=x.replace("w","9");
			x=x.replace("x","9");
			x=x.replace("y","9");
			x=x.replace("z","9");
			x=x.replace("/","0");
			x=x.replace(" ","0");
		   document.stok.box_satuan.value=x;
		}
		//  End -->
</script>